from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By

# 指定 Edge WebDriver 路径（根据你下载的路径修改）
webdriver_path = "H:\chromedriver64\msedgedriver.exe"

# 启动 Edge 浏览器
driver = webdriver.Edge(executable_path=webdriver_path)
# driver = webdriver.Chrome() #创建浏览器对象
# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")
# 放大浏览器页面
driver.maximize_window()

# 通过脚本执行输入用户名、密、电话号码、电子邮件
driver.find_element(By.ID,"userA").send_keys("admin")
driver.find_element(By.CSS_SELECTOR,"[name='passwordA']").send_keys("123456")
driver.find_element(By.CSS_SELECTOR,".telA").send_keys("15999999999")
driver.find_element(By.XPATH,"//p[4]/input").send_keys("admin@qq.com")

# 延迟3秒，修改电话号码
sleep(3)
driver.find_element(By.CSS_SELECTOR,".telA").clear()
driver.find_element_by_css_selector(".telA").send_keys("15999999998")

# 延迟3秒，点击注册
# sleep(3)
driver.find_element_by_css_selector("button").click()
#间隔3秒
sleep(3)
driver.quit()